import { MockMethod } from 'vite-plugin-mock';

const userinfo = {
  code: 2000,
  message: '成功',
  data: {
    access_token: '1221212121123123123123213123', // 访问令牌，随机30个字符
    token_type: 'bearer',
    refresh_token: 'eyJ1c2VySW5mbyI6eyJtb2JpbGUiO', // 刷新令牌，随机30个字符
    expires_in: '1500', // access_token 有效时长(秒)
    scope: 'all', // 权限范围
    userInfo: {
      // 用户信息
      uid: '213', // 用户id
      username: 'ceshi',
      mobile: '12345678912',
      email: '123@qq.com',
      nickName: '测试',
      imageUrl: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif',
    },
    jti: '@word(20)', // token 的唯一标识
  },
};
const outinfos = {
  code: 2000,
  message: '成功',
  data: true,
};

const urlComPath = '/elckerApi/authService/';

export default [
  {
    url: urlComPath + 'login',
    method: 'POST',
    response: () => {
      return userinfo;
    },
  },
  {
    url: urlComPath + 'logout',
    method: 'post',
    response: () => {
      return outinfos;
    },
  },
] as MockMethod[];
